package com.itheima.controller;

import com.itheima.domain.User;
import com.itheima.service.UserService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

    //注入Service
    @Reference
    private UserService userService;


    @RequestMapping(value = "/sayHello",produces = "text/html;charset=utf-8")
    public String sayHello(){
        return userService.sayHello();
    }

    @RequestMapping(value = "/findUser")
    public User findUser(){
        return userService.findUser();
    }

}

